package org.ldh.service.impl;

import org.ldh.dao.BookDao;
import org.ldh.dao.impl.BookDaoImpl;
import org.ldh.domain.Book;
import org.ldh.service.BookService;

import java.util.List;

/**
 * 图书的业务层实现类
 */
public class BookServiceImpl implements BookService {
    //调用dao层
    BookDao bookDao = new BookDaoImpl();

    @Override
    public List<Book> findAll() {
        return bookDao.findAll();
    }

    @Override
    public void saveBook(Book book) {
        bookDao.saveBook(book);
    }

    @Override
    public Book findByName(String bookName) {
        return bookDao.findByName(bookName);
    }

    @Override
    public Book findById(String bookId) {
        return bookDao.findById(bookId);
    }

    @Override
    public void update(Book book) {
        bookDao.update(book);
    }

    @Override
    public void deleteById(String bookId) {
        bookDao.deleteById(bookId);
    }
}
